

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" />
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
  <title>cephadm – 管理本地 cephadm 主机 &mdash; Ceph Documentation</title>
  

  
  <link rel="stylesheet" href="../../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/graphviz.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />

  
  
    <link rel="shortcut icon" href="../../../_static/favicon.ico"/>
  

  
  

  

  
  <!--[if lt IE 9]>
    <script src="../../../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
        <script src="../../../_static/jquery.js"></script>
        <script src="../../../_static/underscore.js"></script>
        <script src="../../../_static/doctools.js"></script>
    
    <script type="text/javascript" src="../../../_static/js/theme.js"></script>

    
    <link rel="index" title="Index" href="../../../genindex/" />
    <link rel="search" title="Search" href="../../../search/" /> 
</head>

<body class="wy-body-for-nav">

   
  <header class="top-bar">
    

















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="../../../" class="icon icon-home"></a> &raquo;</li>
        
      <li>cephadm – 管理本地 cephadm 主机</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
          
            <a href="../../../_sources/man/8/cephadm.rst.txt" rel="nofollow"> View page source</a>
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
  </header>
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search"  style="background: #eee" >
          

          
            <a href="../../../">
          

          
            
            <img src="../../../_static/logo.png" class="logo" alt="Logo"/>
          
          </a>

          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../../search/" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <ul>
<li class="toctree-l1"><a class="reference internal" href="../../../start/intro/">Ceph 简介</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../install/">安装 Ceph</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../cephadm/">Cephadm</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../rados/">Ceph 存储集群</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../cephfs/">Ceph 文件系统</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../rbd/">Ceph 块设备</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../radosgw/">Ceph 对象网关</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../mgr/">Ceph 管理器守护进程</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../mgr/dashboard/">Ceph 仪表盘</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../api/">API 文档</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../architecture/">体系结构</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../dev/developer_guide/">开发者指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../dev/internals/">Ceph 内幕</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../governance/">项目管理</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../foundation/">Ceph 基金会</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../ceph-volume/">ceph-volume</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../releases/general/">Ceph 版本（总目录）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../releases/">Ceph 版本（索引）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../security/">Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../glossary/">Ceph 术语</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../jaegertracing/">Tracing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../translation_cn/">中文版翻译资源</a></li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../../">Ceph</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
<div id="dev-warning" class="admonition note">
  <p class="first admonition-title">Notice</p>
  <p class="last">This document is for a development version of Ceph.</p>
</div>
  <div id="docubetter" align="right" style="padding: 5px; font-weight: bold;">
    <a href="https://pad.ceph.com/p/Report_Documentation_Bugs">Report a Documentation Bug</a>
  </div>

  
  <div class="section" id="cephadm-cephadm">
<h1>cephadm – 管理本地 cephadm 主机<a class="headerlink" href="#cephadm-cephadm" title="Permalink to this headline">¶</a></h1>
<div class="section" id="id1">
<h2>提纲<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h2>
<div class="line-block">
<div class="line"><strong>cephadm**</strong> [-h] [–image IMAGE] [–docker] [–data-dir DATA_DIR]</div>
<div class="line-block">
<div class="line">[–log-dir LOG_DIR] [–logrotate-dir LOGROTATE_DIR]</div>
<div class="line">[–unit-dir UNIT_DIR] [–verbose] [–timeout TIMEOUT]</div>
<div class="line">[–retry RETRY] [–no-container-init]</div>
<div class="line">{version,pull,inspect-image,ls,list-networks,adopt,rm-daemon,rm-cluster,run,shell,enter,ceph-volume,unit,logs,bootstrap,deploy,check-host,prepare-host,add-repo,rm-repo,install}</div>
<div class="line">…</div>
</div>
</div>
<div class="line-block">
<div class="line"><strong>cephadm</strong> <strong>pull</strong></div>
</div>
<div class="line-block">
<div class="line"><strong>cephadm</strong> <strong>inspect-image</strong></div>
</div>
<div class="line-block">
<div class="line"><strong>cephadm</strong> <strong>ls</strong> [-h] [–no-detail] [–legacy-dir LEGACY_DIR]</div>
</div>
<div class="line-block">
<div class="line"><strong>cephadm</strong> <strong>list-networks</strong></div>
</div>
<div class="line-block">
<div class="line"><strong>cephadm</strong> <strong>adopt</strong> [-h] –name NAME –style STYLE [–cluster CLUSTER]</div>
<div class="line-block">
<div class="line">[–legacy-dir LEGACY_DIR] [–config-json CONFIG_JSON]</div>
<div class="line">[–skip-firewalld] [–skip-pull]</div>
</div>
</div>
<div class="line-block">
<div class="line"><strong>cephadm</strong> <strong>rm-daemon</strong> [-h] –name NAME –fsid FSID [–force]</div>
<div class="line-block">
<div class="line">[–force-delete-data]</div>
</div>
</div>
<div class="line-block">
<div class="line"><strong>cephadm</strong> <strong>rm-cluster</strong> [-h] –fsid FSID [–force]</div>
</div>
<div class="line-block">
<div class="line"><strong>cephadm</strong> <strong>run</strong> [-h] –name NAME –fsid FSID</div>
</div>
<div class="line-block">
<div class="line"><strong>cephadm</strong> <strong>shell</strong> [-h] [–fsid FSID] [–name NAME] [–config CONFIG]
[–keyring KEYRING] –mount [MOUNT [MOUNT …]] [–env ENV]
[–] [command [command …]]</div>
</div>
<div class="line-block">
<div class="line"><strong>cephadm</strong> <strong>enter</strong> [-h] [–fsid FSID] –name NAME [command [command …]]</div>
</div>
<div class="line-block">
<div class="line"><strong>cephadm</strong> <strong>ceph-volume</strong> [-h] [–fsid FSID] [–config-json CONFIG_JSON]
[–config CONFIG] [–keyring KEYRING]
command [command …]</div>
</div>
<div class="line-block">
<div class="line"><strong>cephadm</strong> <strong>unit</strong>  [-h] [–fsid FSID] –name NAME command</div>
</div>
<div class="line-block">
<div class="line"><strong>cephadm</strong> <strong>logs</strong> [-h] [–fsid FSID] –name NAME [command [command …]]</div>
</div>
<div class="line-block">
<div class="line"><strong>cephadm</strong> <strong>bootstrap</strong> [-h] [–config CONFIG] [–mon-id MON_ID]</div>
<div class="line-block">
<div class="line">[–mon-addrv MON_ADDRV] [–mon-ip MON_IP]</div>
<div class="line">[–mgr-id MGR_ID] [–fsid FSID]</div>
<div class="line">[–log-to-file] [–single-host-defaults]</div>
<div class="line">[–output-dir OUTPUT_DIR]</div>
<div class="line">[–output-keyring OUTPUT_KEYRING]</div>
<div class="line">[–output-config OUTPUT_CONFIG]</div>
<div class="line">[–output-pub-ssh-key OUTPUT_PUB_SSH_KEY]</div>
<div class="line">[–skip-ssh]</div>
<div class="line">[–initial-dashboard-user INITIAL_DASHBOARD_USER]</div>
<div class="line">[–initial-dashboard-password INITIAL_DASHBOARD_PASSWORD]</div>
<div class="line">[–ssl-dashboard-port SSL_DASHBOARD_PORT]</div>
<div class="line">[–dashboard-key DASHBOARD_KEY]</div>
<div class="line">[–dashboard-crt DASHBOARD_CRT]</div>
<div class="line">[–ssh-config SSH_CONFIG]</div>
<div class="line">[–ssh-private-key SSH_PRIVATE_KEY]</div>
<div class="line">[–ssh-public-key SSH_PUBLIC_KEY]</div>
<div class="line">[–ssh-user SSH_USER] [–skip-mon-network]</div>
<div class="line">[–skip-dashboard] [–dashboard-password-noupdate]</div>
<div class="line">[–no-minimize-config] [–skip-ping-check]</div>
<div class="line">[–skip-pull] [–skip-firewalld] [–allow-overwrite]</div>
<div class="line">[–allow-fqdn-hostname] [–skip-prepare-host]</div>
<div class="line">[–orphan-initial-daemons] [–skip-monitoring-stack]</div>
<div class="line">[–apply-spec APPLY_SPEC]</div>
<div class="line">[–registry-url REGISTRY_URL]</div>
<div class="line">[–registry-username REGISTRY_USERNAME]</div>
<div class="line">[–registry-password REGISTRY_PASSWORD]</div>
<div class="line">[–registry-json REGISTRY_JSON]</div>
</div>
</div>
<div class="line-block">
<div class="line"><strong>cephadm</strong> <strong>deploy</strong> [-h] –name NAME –fsid FSID [–config CONFIG]</div>
<div class="line-block">
<div class="line">[–config-json CONFIG_JSON] [–keyring KEYRING]</div>
<div class="line">[–key KEY] [–osd-fsid OSD_FSID] [–skip-firewalld]</div>
<div class="line">[–tcp-ports TCP_PORTS] [–reconfig] [–allow-ptrace]</div>
</div>
</div>
<div class="line-block">
<div class="line"><strong>cephadm</strong> <strong>check-host</strong> [-h] [–expect-hostname EXPECT_HOSTNAME]</div>
</div>
<div class="line-block">
<div class="line"><strong>cephadm</strong> <strong>prepare-host</strong></div>
</div>
<div class="line-block">
<div class="line"><strong>cephadm</strong> <strong>add-repo</strong> [-h] [–release RELEASE] [–version VERSION]</div>
<div class="line-block">
<div class="line">[–dev DEV] [–dev-commit DEV_COMMIT]</div>
<div class="line">[–gpg-url GPG_URL] [–repo-url REPO_URL]</div>
</div>
</div>
<div class="line-block">
<div class="line"><strong>cephadm</strong> <strong>rm-repo</strong></div>
</div>
<div class="line-block">
<div class="line"><strong>cephadm</strong> <strong>install</strong> [-h] [packages [packages …]]</div>
</div>
<div class="line-block">
<div class="line"><strong>cephadm</strong> <strong>registry-login</strong> [-h] [–registry-url REGISTRY_URL]</div>
<div class="line-block">
<div class="line">[–registry-username REGISTRY_USERNAME]</div>
<div class="line">[–registry-password REGISTRY_PASSWORD]</div>
<div class="line">[–registry-json REGISTRY_JSON] [–fsid FSID]</div>
</div>
</div>
</div>
<div class="section" id="id2">
<h2>描述<a class="headerlink" href="#id2" title="Permalink to this headline">¶</a></h2>
<p><strong class="program">cephadm</strong> 是个命令行工具，用于为 cephadm 编排器管理本地主机。</p>
<p>它有很多命令，可以用于调查和修改当前主机的状态。</p>
<p><strong class="program">cephadm</strong> 不用装在所有主机上，只是在调查某个特定的守护进程时有用。</p>
</div>
<div class="section" id="id3">
<h2>选项<a class="headerlink" href="#id3" title="Permalink to this headline">¶</a></h2>
<dl class="std option">
<dt id="cmdoption-cephadm-image">
<code class="sig-name descname"><span class="pre">--image</span></code><code class="sig-prename descclassname"> <span class="pre">IMAGE</span></code><a class="headerlink" href="#cmdoption-cephadm-image" title="Permalink to this definition">¶</a></dt>
<dd><p>容器映像。也可以通过 CEPHADM_IMAGE 环境变量设置
（默认：无）。</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-cephadm-docker">
<code class="sig-name descname"><span class="pre">--docker</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-cephadm-docker" title="Permalink to this definition">¶</a></dt>
<dd><p>采用 docker 而非 podman (默认: False)</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-cephadm-data-dir">
<code class="sig-name descname"><span class="pre">--data-dir</span></code><code class="sig-prename descclassname"> <span class="pre">DATA_DIR</span></code><a class="headerlink" href="#cmdoption-cephadm-data-dir" title="Permalink to this definition">¶</a></dt>
<dd><p>守护进程数据的顶级目录（默认: /var/lib/ceph ）</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-cephadm-log-dir">
<code class="sig-name descname"><span class="pre">--log-dir</span></code><code class="sig-prename descclassname"> <span class="pre">LOG_DIR</span></code><a class="headerlink" href="#cmdoption-cephadm-log-dir" title="Permalink to this definition">¶</a></dt>
<dd><p>守护进程日志的顶级目录（默认： /var/log/ceph ）</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-cephadm-logrotate-dir">
<code class="sig-name descname"><span class="pre">--logrotate-dir</span></code><code class="sig-prename descclassname"> <span class="pre">LOGROTATE_DIR</span></code><a class="headerlink" href="#cmdoption-cephadm-logrotate-dir" title="Permalink to this definition">¶</a></dt>
<dd><p>logrotate 配置文件的位置（默认： /etc/logrotate.d ）</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-cephadm-unit-dir">
<code class="sig-name descname"><span class="pre">--unit-dir</span></code><code class="sig-prename descclassname"> <span class="pre">UNIT_DIR</span></code><a class="headerlink" href="#cmdoption-cephadm-unit-dir" title="Permalink to this definition">¶</a></dt>
<dd><p>systemd 单元的顶级目录（默认： /etc/systemd/system ）</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-cephadm-verbose">
<span id="cmdoption-cephadm-v"></span><code class="sig-name descname"><span class="pre">--verbose</span></code><code class="sig-prename descclassname"></code><code class="sig-prename descclassname"><span class="pre">,</span> </code><code class="sig-name descname"><span class="pre">-v</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-cephadm-verbose" title="Permalink to this definition">¶</a></dt>
<dd><p>显示调试级的日志消息（默认： False ）</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-cephadm-timeout">
<code class="sig-name descname"><span class="pre">--timeout</span></code><code class="sig-prename descclassname"> <span class="pre">TIMEOUT</span></code><a class="headerlink" href="#cmdoption-cephadm-timeout" title="Permalink to this definition">¶</a></dt>
<dd><p>超时秒数（默认：无）</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-cephadm-retry">
<code class="sig-name descname"><span class="pre">--retry</span></code><code class="sig-prename descclassname"> <span class="pre">RETRY</span></code><a class="headerlink" href="#cmdoption-cephadm-retry" title="Permalink to this definition">¶</a></dt>
<dd><p>重试的最大次数（默认： 10 ）</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-cephadm-no-container-init">
<code class="sig-name descname"><span class="pre">--no-container-init</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-cephadm-no-container-init" title="Permalink to this definition">¶</a></dt>
<dd><p>运行 podman/docker 时不要加 <cite>–init</cite> (默认: False)</p>
</dd></dl>

</div>
<div class="section" id="id4">
<h2>命令<a class="headerlink" href="#id4" title="Permalink to this headline">¶</a></h2>
<div class="section" id="add-repo">
<h3>add-repo<a class="headerlink" href="#add-repo" title="Permalink to this headline">¶</a></h3>
<p>配置本地软件包仓库，以包含 ceph 软件库。</p>
<p>参数：</p>
<ul class="simple">
<li><p>[–release RELEASE]       使用指定大版本的最新版（如 octopus ）</p></li>
<li><p>[–version VERSION]       采用具体的某个上游版本（ x.y.z ）</p></li>
<li><p>[–dev DEV]               采用指定的最前沿构建，来自 git 分支或标签</p></li>
<li><p>[–dev-commit DEV_COMMIT] 采用指定的最前沿构建，来自某个 git 提交</p></li>
<li><p>[–gpg-url GPG_URL]       指定替代的 GPG 密钥位置</p></li>
<li><p>[–repo-url REPO_URL]     指定替代的 repo 位置</p></li>
</ul>
</div>
<div class="section" id="adopt">
<h3>adopt<a class="headerlink" href="#adopt" title="Permalink to this headline">¶</a></h3>
<p>采用不同的部署工具部署好的守护进程。</p>
<p>参数：</p>
<ul class="simple">
<li><p>[–name NAME, -n NAME]       守护进程的名字 (type.id)</p></li>
<li><p>[–style STYLE]              部署风格 (legacy, …)</p></li>
<li><p>[–cluster CLUSTER]          集群的名字</p></li>
<li><p>[–legacy-dir LEGACY_DIR]    遗留守护进程数据的顶级目录</p></li>
<li><p>[–config-json CONFIG_JSON]  JSON 格式的额外配置信息</p></li>
<li><p>[–skip-firewalld]           不要配置 firewalld</p></li>
<li><p>[–skip-pull]                采用前不要拉取最新映像</p></li>
</ul>
</div>
<div class="section" id="bootstrap">
<h3>bootstrap<a class="headerlink" href="#bootstrap" title="Permalink to this headline">¶</a></h3>
<p>在本地主机上自举引导一个集群。它会部署一个 MON 和一个 MGR 、
而后还会在此主机上自动部署监控栈（见 –skip-monitoring-stack ）、
并调用 <code class="docutils literal notranslate"><span class="pre">ceph</span> <span class="pre">orch</span> <span class="pre">host</span> <span class="pre">add</span> <span class="pre">$(hostname)</span></code> （见 –skip-ssh ）。</p>
<p>参数：</p>
<ul class="simple">
<li><p>[–config CONFIG, -c CONFIG]    要合并的 ceph 配置文件</p></li>
<li><p>[–mon-id MON_ID]               mon id （默认：本地主机名）</p></li>
<li><p>[–mon-addrv MON_ADDRV]         mon IPs (例如： [v2:localipaddr:3300,v1:localipaddr:6789])</p></li>
<li><p>[–mon-ip MON_IP]               mon IP 地址</p></li>
<li><p>[–mgr-id MGR_ID]               mgr id （默认：随机生成）</p></li>
<li><p>[–fsid FSID]                   集群的 FSID</p></li>
<li><p>[–log-to-file]                 让集群把日志记录到传统的日志文件中</p></li>
<li><p>[–single-host-defaults]        让集群在单台主机上运行</p></li>
<li><p>[–output-dir OUTPUT_DIR]       写出配置、密钥环和公钥文件的目录</p></li>
<li><p>[–output-keyring OUTPUT_KEYRING] 写出装载新集群 admin 和 mon 密钥的密钥环文件的路径</p></li>
<li><p>[–output-config OUTPUT_CONFIG] 写出用于连接新集群的配置文件的路径</p></li>
<li><p>[–output-pub-ssh-key OUTPUT_PUB_SSH_KEY] 写出集群 SSH 公钥的路径</p></li>
<li><p>[–skip-ssh                     跳过本机上的 ssh 密钥配置</p></li>
<li><p>[–initial-dashboard-user INITIAL_DASHBOARD_USER] dashboard 的初始用户</p></li>
<li><p>[–initial-dashboard-password INITIAL_DASHBOARD_PASSWORD] 初始 dashboard 用户的初始密码</p></li>
<li><p>[–ssl-dashboard-port SSL_DASHBOARD_PORT] 通过 SSL 连接 dashboard 的端口号</p></li>
<li><p>[–dashboard-key DASHBOARD_KEY] Dashboard 密钥</p></li>
<li><p>[–dashboard-crt DASHBOARD_CRT] Dashboard 证书</p></li>
<li><p>[–ssh-config SSH_CONFIG]       SSH 配置</p></li>
<li><p>[–ssh-private-key SSH_PRIVATE_KEY] SSH 私钥</p></li>
<li><p>[–ssh-public-key SSH_PUBLIC_KEY] SSH 公钥</p></li>
<li><p>[–ssh-user SSH_USER]           通过 SSH 登陆集群主机的用户名，对于非 root 用户需要预先配置好无密码 sudo</p></li>
<li><p>[–skip-mon-network]            根据 mon IP 配置 public_network</p></li>
<li><p>[–skip-dashboard]              不要启用 Ceph Dashboard</p></li>
<li><p>[–dashboard-password-noupdate] 不要强制让用户更改 dashboard 密码</p></li>
<li><p>[–no-minimize-config]          不要同化并最小化配置文件</p></li>
<li><p>[–skip-ping-check]             不要检验 mon IP 地址是否可以 ping</p></li>
<li><p>[–skip-pull]                   自举引导前不要拉取最新映像</p></li>
<li><p>[–skip-firewalld]              不要配置 firewalld</p></li>
<li><p>[–allow-overwrite]             允许覆盖已有的 –output-* config/keyring/ssh 文件</p></li>
<li><p>[–allow-fqdn-hostname]         允许全资主机名（包含点 “.” 的）</p></li>
<li><p>[–skip-prepare-host]           不要准备主机</p></li>
<li><p>[–orphan-initial-daemons]      不要创建初始的 mon 、 mgr 和崩溃服务规范</p></li>
<li><p>[–skip-monitoring-stack]       不要自动提供监控栈(prometheus, grafana, alertmanager, node-exporter)</p></li>
<li><p>[–apply-spec APPLY_SPEC]       自举引导之后按规范配置集群（复制 ssh 密钥、增加主机并应用服务）</p></li>
<li><p>[–registry-url REGISTRY_URL]   要登录的自制注册处的 URL ，例如 docker.io 、 quay.io</p></li>
<li><p>[–registry-username REGISTRY_USERNAME] 登录自制注册处的帐户用户名</p></li>
<li><p>[–registry-password REGISTRY_PASSWORD] 登录自制注册处的帐户密码</p></li>
<li><p>[–registry-json REGISTRY_JSON] 包含注册处登录信息的 JSON 文件（见 registry-login 命令的文档）</p></li>
</ul>
</div>
<div class="section" id="ceph-volume">
<h3>ceph-volume<a class="headerlink" href="#ceph-volume" title="Permalink to this headline">¶</a></h3>
<p>在容器内运行 ceph-volume:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">cephadm</span> <span class="n">ceph</span><span class="o">-</span><span class="n">volume</span> <span class="n">inventory</span>
</pre></div>
</div>
<p>位置参数：
* [command]               命令</p>
<p>参数：</p>
<ul class="simple">
<li><p>[–fsid FSID]                    集群的 FSID</p></li>
<li><p>[–config-json CONFIG_JSON]      有配置和（ client.bootrap-osd ）密钥的 JSON 文件</p></li>
<li><p>[–config CONFIG, -c CONFIG]     ceph 配置文件</p></li>
<li><p>[–keyring KEYRING, -k KEYRING]  要传进容器的 ceph.keyring</p></li>
</ul>
</div>
<div class="section" id="check-host">
<h3>check-host<a class="headerlink" href="#check-host" title="Permalink to this headline">¶</a></h3>
<p>检查主机配置是否适合 Ceph 集群。</p>
<p>参数：</p>
<ul class="simple">
<li><p>[–expect-hostname EXPECT_HOSTNAME] 检查主机名与期望的值是否匹配</p></li>
</ul>
</div>
<div class="section" id="deploy">
<h3>deploy<a class="headerlink" href="#deploy" title="Permalink to this headline">¶</a></h3>
<p>在本地主机上部署一个守护进程。编排器 CLI 会用到：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">cephadm</span> <span class="n">shell</span> <span class="o">--</span> <span class="n">ceph</span> <span class="n">orch</span> <span class="n">apply</span> <span class="o">&lt;</span><span class="nb">type</span><span class="o">&gt;</span> <span class="o">...</span>
</pre></div>
</div>
<p>参数：</p>
<ul class="simple">
<li><p>[–name NAME]               守护进程的名字 (type.id)</p></li>
<li><p>[–fsid FSID]               集群的 FSID</p></li>
<li><p>[–config CONFIG, -c CONFIG] 新守护进程的配置文件</p></li>
<li><p>[–config-json CONFIG_JSON] JSON 格式的附加配置信息</p></li>
<li><p>[–keyring KEYRING]         新守护进程的密钥环</p></li>
<li><p>[–key KEY]                 新守护进程的密钥</p></li>
<li><p>[–osd-fsid OSD_FSID]       OSD uuid ，如果在创建 OSD 容器</p></li>
<li><p>[–skip-firewalld]          不要配置 firewalld</p></li>
<li><p>[–tcp-ports                要在主机防火墙上开放的 TCP 端口列表</p></li>
<li><p>[–reconfig]                重新配置一个之前部署的守护进程</p></li>
<li><p>[–allow-ptrace]            在守护进程容器中打开 SYS_PTRACE</p></li>
</ul>
</div>
<div class="section" id="enter">
<h3>enter<a class="headerlink" href="#enter" title="Permalink to this headline">¶</a></h3>
<p>在运行着的守护进程容器内打开一个交互式 shell:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">cephadm</span> <span class="n">enter</span> <span class="o">--</span><span class="n">name</span> <span class="n">mgr</span><span class="o">.</span><span class="n">myhost</span><span class="o">.</span><span class="n">ysubfo</span>
</pre></div>
</div>
<p>位置参数：
* [command]               命令</p>
<p>参数：</p>
<ul class="simple">
<li><p>[–fsid FSID]           集群的 FSID</p></li>
<li><p>[–name NAME, -n NAME]  守护进程的名字 (type.id)</p></li>
</ul>
</div>
<div class="section" id="install">
<h3>install<a class="headerlink" href="#install" title="Permalink to this headline">¶</a></h3>
<p>安装 ceph 软件包。</p>
<p>位置参数：</p>
<ul class="simple">
<li><p>[packages]    软件包</p></li>
</ul>
</div>
<div class="section" id="inspect-image">
<h3>inspect-image<a class="headerlink" href="#inspect-image" title="Permalink to this headline">¶</a></h3>
<p>检查本地的 ceph 容器映像。</p>
</div>
<div class="section" id="list-networks">
<h3>list-networks<a class="headerlink" href="#list-networks" title="Permalink to this headline">¶</a></h3>
<p>罗列 IP 网络段。</p>
</div>
<div class="section" id="ls">
<h3>ls<a class="headerlink" href="#ls" title="Permalink to this headline">¶</a></h3>
<p>罗列 <strong>这台</strong> 主机上 cephadm 知道的守护进程例程：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ cephadm ls
[
    {
        &quot;style&quot;: &quot;cephadm:v1&quot;,
        &quot;name&quot;: &quot;mgr.storage-14b-1.ysubfo&quot;,
        &quot;fsid&quot;: &quot;5110cb22-8332-11ea-9148-0894ef7e8bdc&quot;,
        &quot;enabled&quot;: true,
        &quot;state&quot;: &quot;running&quot;,
        &quot;container_id&quot;: &quot;8562de72370a3836473ecfff8a22c9ccdd99815386b4692a2b30924fb5493c44&quot;,
        &quot;container_image_name&quot;: &quot;docker.io/ceph/ceph:v15&quot;,
        &quot;container_image_id&quot;: &quot;bc83a388465f0568dab4501fb7684398dca8b50ca12a342a57f21815721723c2&quot;,
        &quot;version&quot;: &quot;15.2.1&quot;,
        &quot;started&quot;: &quot;2020-04-21T01:16:41.831456&quot;,
        &quot;created&quot;: &quot;2020-04-21T01:16:41.775024&quot;,
        &quot;deployed&quot;: &quot;2020-04-21T01:16:41.415021&quot;,
        &quot;configured&quot;: &quot;2020-04-21T01:16:41.775024&quot;
    },
...
</pre></div>
</div>
<p>参数：</p>
<ul class="simple">
<li><p>[–no-detail]             不要显示守护进程状态</p></li>
<li><p>[–legacy-dir LEGACY_DIR] 遗留守护进程数据的顶级目录</p></li>
</ul>
</div>
<div class="section" id="logs">
<h3>logs<a class="headerlink" href="#logs" title="Permalink to this headline">¶</a></h3>
<p>打印一个守护进程容器的 journald 日志：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">cephadm</span> <span class="n">logs</span> <span class="o">--</span><span class="n">name</span> <span class="n">mgr</span><span class="o">.</span><span class="n">myhost</span><span class="o">.</span><span class="n">ysubfo</span>
</pre></div>
</div>
<p>和这个相似：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">journalctl</span> <span class="o">-</span><span class="n">u</span> <span class="n">mgr</span><span class="o">.</span><span class="n">myhost</span><span class="o">.</span><span class="n">ysubfo</span>
</pre></div>
</div>
<p>还能指定额外的日志参数：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">cephadm</span> <span class="n">logs</span> <span class="o">--</span><span class="n">name</span> <span class="n">mgr</span><span class="o">.</span><span class="n">myhost</span><span class="o">.</span><span class="n">ysubfo</span> <span class="o">--</span> <span class="o">-</span><span class="n">n</span> <span class="mi">20</span> <span class="c1"># last 20 lines</span>
<span class="n">cephadm</span> <span class="n">logs</span> <span class="o">--</span><span class="n">name</span> <span class="n">mgr</span><span class="o">.</span><span class="n">myhost</span><span class="o">.</span><span class="n">ysubfo</span> <span class="o">--</span> <span class="o">-</span><span class="n">f</span> <span class="c1"># follow the log</span>
</pre></div>
</div>
<p>位置参数：</p>
<ul class="simple">
<li><p>[command]               命令（可选的）</p></li>
</ul>
<p>参数：</p>
<ul class="simple">
<li><p>[–fsid FSID]           集群的 FSID</p></li>
<li><p>[–name NAME, -n NAME]  守护进程的名字 (type.id)</p></li>
</ul>
</div>
<div class="section" id="prepare-host">
<h3>prepare-host<a class="headerlink" href="#prepare-host" title="Permalink to this headline">¶</a></h3>
<p>准备一台主机给 cephadm 用。</p>
<p>参数：</p>
<ul class="simple">
<li><p>[–expect-hostname EXPECT_HOSTNAME] 设置主机名</p></li>
</ul>
</div>
<div class="section" id="pull">
<h3>pull<a class="headerlink" href="#pull" title="Permalink to this headline">¶</a></h3>
<p>拉取 ceph 映像：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">cephadm</span> <span class="n">pull</span>
</pre></div>
</div>
</div>
<div class="section" id="registry-login">
<h3>registry-login<a class="headerlink" href="#registry-login" title="Permalink to this headline">¶</a></h3>
<p>向 cephadm 提供登录信息，以便与注册处认证（ URL 、用户名和密码）。
Cephadm 将尝试让调用主机登录进那个注册处：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">cephadm</span> <span class="n">registry</span><span class="o">-</span><span class="n">login</span> <span class="o">--</span><span class="n">registry</span><span class="o">-</span><span class="n">url</span> <span class="p">[</span><span class="n">REGISTRY_URL</span><span class="p">]</span> <span class="o">--</span><span class="n">registry</span><span class="o">-</span><span class="n">username</span> <span class="p">[</span><span class="n">USERNAME</span><span class="p">]</span>
                       <span class="o">--</span><span class="n">registry</span><span class="o">-</span><span class="n">password</span> <span class="p">[</span><span class="n">PASSWORD</span><span class="p">]</span>
</pre></div>
</div>
<p>也可以用如下格式的 JSON 文件装载登录信息：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
 <span class="s2">&quot;url&quot;</span><span class="p">:</span><span class="s2">&quot;REGISTRY_URL&quot;</span><span class="p">,</span>
 <span class="s2">&quot;username&quot;</span><span class="p">:</span><span class="s2">&quot;REGISTRY_USERNAME&quot;</span><span class="p">,</span>
 <span class="s2">&quot;password&quot;</span><span class="p">:</span><span class="s2">&quot;REGISTRY_PASSWORD&quot;</span>
<span class="p">}</span>
</pre></div>
</div>
<p>然后用命令代入它：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">cephadm</span> <span class="n">registry</span><span class="o">-</span><span class="n">login</span> <span class="o">--</span><span class="n">registry</span><span class="o">-</span><span class="n">json</span> <span class="p">[</span><span class="n">JSON</span> <span class="n">FILE</span><span class="p">]</span>
</pre></div>
</div>
<p>参数：</p>
<ul class="simple">
<li><p>[–registry-url REGISTRY_URL]   要登录的注册处的 URL ，例如 docker.io 、 quay.io</p></li>
<li><p>[–registry-username REGISTRY_USERNAME] 登录注册处的帐户用户名</p></li>
<li><p>[–registry-password REGISTRY_PASSWORD] 登录注册处的帐户密码</p></li>
<li><p>[–registry-json REGISTRY_JSON] 包含注册处登录信息的 JSON 文件</p></li>
<li><p>[–fsid FSID]                   集群的 FSID</p></li>
</ul>
</div>
<div class="section" id="rm-daemon">
<h3>rm-daemon<a class="headerlink" href="#rm-daemon" title="Permalink to this headline">¶</a></h3>
<p>删除某个特定的守护进程例程。</p>
<p>参数：</p>
<ul class="simple">
<li><p>[–name NAME, -n NAME]  守护进程的名字 (type.id)</p></li>
<li><p>[–fsid FSID]           集群的 FSID</p></li>
<li><p>[–force]               继续进行，即使这样可能损坏有价值的数据</p></li>
<li><p>[–force-delete-data]   不做备份，直接删除有用的守护进程数据</p></li>
</ul>
</div>
<div class="section" id="rm-cluster">
<h3>rm-cluster<a class="headerlink" href="#rm-cluster" title="Permalink to this headline">¶</a></h3>
<p>删除一个集群的所有守护进程。</p>
<p>参数：</p>
<ul class="simple">
<li><p>[–fsid FSID]  集群的 FSID</p></li>
<li><p>[–force]      继续进行，即使这样可能损坏有价值的数据。</p></li>
</ul>
</div>
<div class="section" id="rm-repo">
<h3>rm-repo<a class="headerlink" href="#rm-repo" title="Permalink to this headline">¶</a></h3>
<p>删除软件仓库配置。</p>
</div>
<div class="section" id="run">
<h3>run<a class="headerlink" href="#run" title="Permalink to this headline">¶</a></h3>
<p>在容器内运行一个 ceph 守护进程，在前台。</p>
<p>参数：</p>
<ul class="simple">
<li><p>[–name NAME, -n NAME]  守护进程的名字 (type.id)</p></li>
<li><p>[–fsid FSID]           集群的 FSID</p></li>
</ul>
</div>
<div class="section" id="shell">
<h3>shell<a class="headerlink" href="#shell" title="Permalink to this headline">¶</a></h3>
<p>启动一个交互式 shell:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">cephadm</span> <span class="n">shell</span>
</pre></div>
</div>
<p>或者容器内一个特定的命令：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">cephadm</span> <span class="n">shell</span> <span class="o">--</span> <span class="n">ceph</span> <span class="n">orch</span> <span class="n">ls</span>
</pre></div>
</div>
<p>位置参数：</p>
<ul class="simple">
<li><p>[command]               命令（可选的）</p></li>
</ul>
<p>参数：</p>
<ul class="simple">
<li><p>[–fsid FSID]                   集群的 FSID</p></li>
<li><p>[–name NAME, -n NAME]          守护进程的名字 (type.id)</p></li>
<li><p>[–config CONFIG, -c CONFIG]    要传给容器的 ceph.conf</p></li>
<li><p>[–keyring KEYRING, -k KEYRING] 要传给容器的 ceph.keyring</p></li>
<li><p>[–mount MOUNT, -m MOUNT]       在容器内的 /mnt 下挂载一个文件或目录</p></li>
<li><p>[–env ENV, -e ENV]             设置环境变量</p></li>
</ul>
</div>
<div class="section" id="unit">
<h3>unit<a class="headerlink" href="#unit" title="Permalink to this headline">¶</a></h3>
<p>操作守护进程的 systemd 单元。</p>
<p>位置参数：</p>
<ul class="simple">
<li><p>[command]               systemd 命令 (start, stop, restart, enable, disable, …)</p></li>
</ul>
<p>参数：</p>
<ul class="simple">
<li><p>[–fsid FSID]           集群的 FSID</p></li>
<li><p>[–name NAME, -n NAME]  守护进程的名字 (type.id)</p></li>
</ul>
</div>
</div>
<div class="section" id="id5">
<h2>使用范围<a class="headerlink" href="#id5" title="Permalink to this headline">¶</a></h2>
<p><strong>cephadm</strong> 是 Ceph 的一部分，这是个伸缩力强、开源、
分布式的存储系统，更多信息参见 <a class="reference external" href="https://docs.ceph.com">https://docs.ceph.com</a> 。</p>
</div>
<div class="section" id="id6">
<h2>参考<a class="headerlink" href="#id6" title="Permalink to this headline">¶</a></h2>
<p><a class="reference internal" href="../ceph-volume/"><span class="doc">ceph-volume</span></a>(8),</p>
</div>
</div>



           </div>
           
          </div>
          <footer>

  <hr/>

  <div role="contentinfo">
    <p>
        &#169; Copyright 2016, Ceph authors and contributors. Licensed under Creative Commons Attribution Share Alike 3.0 (CC-BY-SA-3.0).

    </p>
  </div> 

</footer>
        </div>
      </div>

    </section>

  </div>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>